$(function(){
	if ($.cookie('easyuiThemeName')) {
		parent.changeThemeFun($.cookie('easyuiThemeName'));
	}
		$.ajax({
			   type: "POST",
			   url: "showUserName",
			   data: "",
			   success: function(msg){
				$('#username').html(msg.username);
			   }
		});
})



function savaPsw(){
	var r = $('#dataForm').form('validate');
	if (!r) {
		return false;
	}
	var b = $('#user_password2').val();
	var c = $('#user_password3').val();
	if(b != c){
		$.messager.alert('信息框','新密码与确认密码要一致!');
		return false;
	}
	
	var url = "updatePassWord?" +encodeURI($("#dataForm").ajaxForm().formSerialize());
	$.post(url,function(json){
		if(json.flag){
			$.messager.alert('信息框','修改密码成功!');
			cancelFunc();
		}else{
			$.messager.alert('信息框','修改密码失败!'+json.error);
		}
	})
}


function cancelFunc(){
	$('#user_password1').val('');
	$('#user_password2').val('');
	$('#user_password3').val('');
}